<#assign module="freight">
<@override name="header">
<link rel="stylesheet" href="${ctx}/assets/css/gird.css">
<link rel="stylesheet" href="${ctx}/assets/css/jquery-labelauty.css">
<link rel="stylesheet" href="${ctx}/assets/css/datetimepicker.css">
<style>
	/* autocomplete */
	div.ac {border: 1px solid #ccc;position:absolute;display: none;overflow: auto;background-color: #ffffff;z-index:99999;}
	div.ac > ul {margin-top:10px;padding:0;}
	div.ac > ul > li {height:33px;line-height:33px;cursor:pointer;}
	div.ac > ul > li:hover{background:#eee;}
	div.ac > ul > li > div span {padding-left:15px;}
	div.ac > ul > li > div span em {color:red;font-style: normal;}
	.inputTime
		{
		   height:35px;
		   width:260px;
		   border:1px solid #ccc;
		   border-radius:4px;
		   padding:6px 12px;
		}
		ul { list-style-type: none;}
.dowebok > li { display: inline-block;}
.dowebok > li { margin: 10px 0;}
input.labelauty + label { font: 12px "Microsoft Yahei";}
</style>
</@override>

<@override name="body">
<div class="row">
	<div class="col-md-10">
		<form class="form-inline" role="form">
		    <@shiro.isMainCompany>
				<div class="form-group">
					<select class="form-control" name="companyId">
						<option value="">--全部公司--</option>
						<#if companys??>
							<#list companys as company>
								<option value="${company.id}" <#if companyId?? && companyId==company.id>selected="selected"</#if>>${company.abbreviation?if_exists}</option>
							</#list>
						</#if>
					</select>
			    </div>
		    </@shiro.isMainCompany>
		    <div class="form-group">
				<select class="form-control" name="status">
					<option value="-1">--全部状态--</option>
					<option value="0" <#if status?? && status==0>selected="selected"</#if>>新单</option>
					<option value="1" <#if status?? && status==1>selected="selected"</#if>>已派单</option>
					<option value="2" <#if status?? && status==2>selected="selected"</#if>>已接单</option>
					<option value="3" <#if status?? && status==3>selected="selected"</#if>>执行中</option>
					<option value="4" <#if status?? && status==4>selected="selected"</#if>>已完成</option>
					<option value="5" <#if status?? && status==5>selected="selected"</#if>>已销单</option>
				</select>
		    </div>
			<div class="form-group">
			    <input type="text" class="form-control" name="orderNo" value="${orderNo?if_exists}" placeholder="订单号">
		  	</div>
			<div class="form-group">
			    <input type="text" class="form-control" name="employName" value="${employName?if_exists}" placeholder="服务人员姓名">
		  	</div>
			<div class="form-group">
			    <input type="text" class="form-control" name="employPhone" value="${employPhone?if_exists}" placeholder="服务人员电话">
		  	</div>
			<div class="form-group">
			    <input type="text" class="form-control" name="passengerName" value="${passengerName?if_exists}" placeholder="客户姓名">
		  	</div>
			<div class="form-group">
			    <input type="text" class="form-control" name="passengerPhone" value="${passengerPhone?if_exists}" placeholder="客户电话">
		  	</div>
			<div class="form-group">
			    <input type="text" class="form-control" name="truckType" value="${truckType?if_exists}" placeholder="货车类型">
		  	</div>
		  	<button type="submit" class="btn btn-default"><i class="icon-search"></i>&nbsp;搜索</button>
	    </form>
	</div>
    <div class="col-md-2">
		<button id="addOrder" class="pull-right button button-rounded button-flat-blue" ><i class="icon-plus"></i>&nbsp;添加订单</button>
	</div>
</div>
<div class="row margin-top">
	<div class="col-xs-12">
		<div class="panel panel-primary">
		<div class="table-responsive">
			<table class="table table-hover table-striped">
					<thead>
						<tr>
							<th style="padding-left:20px;max-width:40px;">状态</th>
							<th>订单号</th>
							<@shiro.isMainCompany>
							<th>所属公司</th>
							</@shiro.isMainCompany>
							<th>下单时间</th>
							<th>订单来源</th>
							<th>预约时间</th>
							<th>预计金额(元)</th>
							<th>客户</th>
							<th>服务人员</th>
							<th>货车类型</th>
							<#if status?? && status==5>
							<th>销单原因</th>
							</#if>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
					<#if (page.content)?? >
					<#list page.content as order>
					   <td style="padding-left:15px;">
							<#if order.status==0>
								<span class="label label-info">新单</span>
							<#elseif order.status==1>
								<span class="label label-warning">已派单</span>
							<#elseif order.status==2>
								<span class="label label-danger">已接单 </span>
							<#elseif order.status==3>
								<span class="label label-success">执行中</span>
							<#elseif order.status==4>
								<span class="label label-success">已完成</span>
							<#elseif order.status==5>
								<span class="label label-default">已销单</span>
							</#if>
						</td>
						<td  align="center"><a href="${ctx}/freight/orderDetails/${order.id}">${order.orderNo?if_exists}</a></td>
						<@shiro.isMainCompany>
						<td style="width:6%">${order.companyName?if_exists}</td>
						</@shiro.isMainCompany>
						<td  align="center">${order.created?string('yyyy-MM-dd HH:mm')}</td>
						<td  align="center">${order.channelName?if_exists}</td>
						<td  align="center">${order.startTime?string('yyyy-MM-dd HH:mm')}</td>
						
						<td  align="center">${order.budgetPay!0}</td>
						<td  align="center">${order.passengerName?if_exists}</br>${order.passengerPhone?if_exists}</td>
						<td  align="center">${order.employName!"-"}</br>${order.employPhone!"-"}</td>
						<td  align="center">${order.truckTypeName!"-"}<#if order.truckType.cangointotown>--入城</#if></td>
						<#if status?? && status==5>
						<td  align="center">${order.cancelCause!"--"}</td>
						</#if>
						<td  align="center">
						<a href="#"class="zhuijia" orderId="${order.id}">追加</a>&ensp;
						<a href="#" orderId="${order.id}">派单</a>&ensp;
						<a href="#" orderId="${order.id}" orderNo="${order.orderNo}" orderMemo="${order.memo?if_exists}" class="modifyCash">备注</a>&ensp;
						<#if order.status!=4 && order.status!=5>
							<a href="#" orderId="${order.id}" orderNo="${order.orderNo}"  class="cancel">销单</a>
						</#if>
						</td>
						</tr>
					</#list>	
				</#if>
					</tbody>
				</table>
			<#if page.totalElements??>
			 <ul class="pagination pull-right pagination-sm">
				<li><a>共 ${page.totalElements} 条数据</a></li>
				<@pg.pager items=page.totalElements?number maxPageItems=20 export="currentPageNumber=pageNumber" url="${ctx}/freight/orders">
					<@shiro.isMainCompany>
						<@pg.param name="companyId" value="${companyId?if_exists}"/>
					</@shiro.isMainCompany>
					<@pg.param name="orderNo" 		 value="${orderNo?if_exists}"/>
					<@pg.param name="employName" 	 value="${employName?if_exists}"/>
					<@pg.param name="employPhone" 	 value="${employPhone?if_exists}"/>
					<@pg.param name="passengerName"  value="${passengerName?if_exists}"/>
					<@pg.param name="passengerPhone" value="${passengerPhone?if_exists}"/>
					<@pg.param name="carNumber"	 	 value="${truckType?if_exists}"/>
					<@pg.param name="status"	 	 value="${status?if_exists}"/>
					<@pg.index>
						<@pg.first>
							<li><a href="${pageUrl}">&laquo;</a></li>
						</@pg.first>
						<@pg.prev>
							<li><a href="${pageUrl}">&lsaquo;</a></li>
						</@pg.prev>
						<@pg.pages>
							<#if  currentPageNumber == pageNumber >
								<li class="active"><a href="#">${pageNumber}</a></li>
							<#else>
								<li><a href="${pageUrl}">${pageNumber}</a></li>
							</#if>
						</@pg.pages>
						<@pg.next>
							<li><a href="${pageUrl}">&rsaquo;</a></li>
						</@pg.next>
						<@pg.last>
							<li><a href="${pageUrl}">&raquo;</a></li>
						</@pg.last>
					</@pg.index>
				</@pg.pager>
			   </ul>
			</#if>
		</div>
	  </div>
	</div>
</div>
 <!--添加订单-->
<div class="form-horizontal" id="kk" >
	<div class="modal fade" id="dialog_order" data-backdrop="static" style="z-index:8888;" >
	     <div class="modal-content" style="margin-left:420px;margin-top:100px;width:1000px;">
	    	<div class="modal-header">
		        <button type="button" class="close" data-dismiss="modal" aria-hidden="false">&times;</button>
	        	<h4 class="modal-title">货车订单</h4>
	        </div>
		    <div class="modal-body" style="width:1000px;">
	      	<form action=""  method="post">
	      		<input type="hidden" id="passengerId">
	      		<input type="hidden" id="startLat">
	      		<input type="hidden" id="startLng" >
	      		<input type="hidden" id="endLat" >
	      		<input type="hidden" id="endLng" >
	      		<input type="hidden" id="startPrice" >
		  		<input type="hidden" id="mileagePrice" >
		  		<input type="hidden" id="runTimePrice" >
		  		<input type="hidden" id="runTime" >
		  		<input type="hidden" id="mileage" >
		  		<input type="hidden" id="employId" >
		  		<div class="col-sm-6" style="z-index:8888; height:600px;">
	      		<div id="freight_allmap" class="col-sm-12" style="z-index:8888; height:600px;">
    			</div>
    			</div>
	      		<div class="col-sm-6">
	      			<div class="form-group">
	                    <label class="col-sm-3 control-label">客户电话:</label>
	                    <div class="col-sm-9">
	                    	<input id="passengerPhone"  class="form-control"></input>
	                    </div>
					</div>
					<div class="form-group">
	                    <label class="col-sm-3 control-label">客户姓名:</label>
	                    <div class="col-sm-9">
	                    	<input id="passengerName"  class="form-control" ></input>
	                    </div>
					</div>
	      			<div class="form-group">
		                <label class="col-sm-3 control-label">所属公司:</label>
		                <div class="col-sm-9">
			                <select class="form-control" id="companyId" >
								<#if companys??>
									<option value="">请选择公司</option>
									<#list companys as company>
										<option value="${company.id}" <#if companyId?? && companyId==company.id>selected="selected"</#if>>${company.abbreviation?if_exists}</option>
									</#list>
								</#if>
							</select>
		                </div>
					 </div>
					 
	                <div class="form-group wayAddress" id="start">
	                    <label class="col-sm-3 control-label" style="margin-top:50px;">始发地:</label>
	                    <div class="col-sm-8">
	                        <div class="panel panel-default">
	                           <div class="panel-body" style="padding:2 0 2 0;">
	                             <div>
	                                 <div style="padding:1 0 1 0">
	                                     <label class="col-sm-3 control-label">地址:</label>
	                                     <div class="col-sm-9">
	                                          <input class="form-control waypointAddress" onblur='position(this)' index="0" waypointLng="" waypointLat="" id="startAddress">
	                                          <label class="position" style="cursor:pointer;float:right;margin-right:-18px;margin-top:-26px;">
	                                             <i class=" icon-screenshot" title="定位"></i>
	                                          </label>
	                                     </div>
	                                 </div>
	                             <div>
	                             <label class="control-label col-sm-4" style="margin-left:-22px;">联系人:</label>
	                             <div style="width:165px;display:inline-block;margin-left:16px;">
	                             <input class="form-control waypointContacts" />
	                             </div>
	                         </div>
	                       <div>
	                       <label class="col-sm-3 control-label">电话:</label><div class="col-sm-9">
	                       <input class="form-control waypointPhone" required/></div></div></div></div></div></div><div class="input-group">
	                       </div><div class="input-group"></div></div>
	                
	            <div id="waypointItem">
	                
				</div>
					<div class="form-group wayAddress" id="end">
	                    <label class="col-sm-3 control-label" style="margin-top:50px;">目的地:</label>
	                    <div class="col-sm-8">
	                        <div class="panel panel-default">
	                           <div class="panel-body" style="padding:2 0 2 0;">
	                             <div>
	                                 <div style="padding:1 0 1 0">
	                                     <label class="col-sm-3 control-label">地址:</label>
	                                     <div class="col-sm-9">
	                                          <input class="form-control waypointAddress" onblur='position(this)' index="1" waypointLng="" waypointLat="" id="destination">
	                                          <label class="position" style="cursor:pointer;float:right;margin-right:-18px;margin-top:-26px;">
	                                             <i class=" icon-screenshot" title="定位"></i>
	                                          </label>
	                                     </div>
	                                 </div>
	                             <div>
	                             <label class="control-label col-sm-4" style="margin-left:-22px;">联系人:</label>
	                             <div style="width:165px;display:inline-block;margin-left:16px;">
	                             <input class="form-control waypointContacts" id="contacts"/>
	                             </div>
	                         </div>
	                       <div>
	                       <label class="col-sm-3 control-label">电话:</label><div class="col-sm-9">
	                       <input class="form-control waypointPhone" id="phone" required/></div></div></div></div></div></div><div class="input-group">
                        	<label><i class=" icon-plus icon-1x waypointIcon addAddress" style="cursor:pointer;" title="添加途径地"></i></label>
	                       </div><div class="input-group"></div></div>
	                
					<div class="form-group">
		                <label class="col-sm-3 control-label">预约时间:</label>
		                <div class="col-sm-9 input-append date " >
							  <input  class="inputTime"  id="startTime" type="text"/>
							  <span class="add-on"><i class="icon-calendar"></i></span>
		                </div>
	                </div>
	                <div class="form-group">
						<label class="col-sm-3 control-label">货车类型:</label>
		                <div class="col-sm-9">
			                <select class="form-control" id="truckTypeId" >
								<#if truckTypes??>
									<#list truckTypes as truckType>
										<option value="${truckType.id}">${truckType.typeName?if_exists}<#if truckType.cangointotown>--入城</#if></option>
									</#list>
								</#if>
							</select>
		                </div>
					 </div>
				    <div class="form-group">
					 	<label class="col-sm-3 control-label">预计金额:</label>
	                    <div class="col-sm-9">
	                    	<div class="input-group">
					          <input class="form-control" id="budgetPay" type="number" min="0" />
				      		  <span class="input-group-addon">元</span>
				      		</div>
		                </div>
	                </div>
	                 <div class="form-group">
	                  <div class="input-group" style="margin-left:97px;">
					 	<ul class="dowebok">
							<li><input type="checkbox" name="flitting"  data-labelauty="搬运"></li>
							<li><input type="checkbox" name="receipt"  data-labelauty="回单"></li>
							<li><input type="checkbox" name="receivedPay"   data-labelauty="回款"></li>
							<li style="position:relative;top:-5px;left:0px;display:none;" class="receivedPay">
							     <input class="form-control" placeholder="金额" type="number" min="0" name="payMount" style="width:80px;"/>
						 	     <span class="input-group-addon" style="height:34px;margin-top:50px;">元</span>
							</li>
						</ul>
						
						</div>
	                </div>
				 	<div class="form-group" style="margin-top:-35px;">
				 	 	<div class="col-sm-3">
	            	 	</div>
				 		<div class="col-sm-9 detail">				               
		                  <span class="mileage"></span>&nbsp&nbsp<span class="runTime"></span>
		                </div>
	                </div>
	                 <div class="form-group">
						<label class="col-sm-3 control-label"><em>&nbsp;&nbsp;</em>订单备注:</label>
						<div class="col-sm-9">
							 <textarea class="form-control" cols="20" id='orderMemo' name="memo" rows="4"></textarea>
						</div>
					 </div>
	               
	                <div class="form-group">
				 	 	<div class="col-sm-3">
	            	 	</div>
				 	 	<div class="col-sm-9">
	                 	  <input  type="button" class="btn btn-primary" id="saveOrder" value="预约"/>
					      <button type="button"  class="btn btn-default" id="close_modal">取消</button>
				        </div>
			        </div>
			        
	               
										
			 	</div>
			 	<div class="form-group">
				</div>
		  	</form>
	     	</div>
	     </div>
	</div>
</div>


<div class="form-horizontal" >
	<div class="modal fade" id="zj_dialog_order" data-backdrop="static" style="z-index:8888;" >
	     <div class="modal-content" style="margin-left:420px;margin-top:100px;width:1000px;">
	    	<div class="modal-header">
		        <button type="button" class="close zj_close_modal" id="zj_close" data-dismiss="modal" aria-hidden="false">&times;</button>
	        	<h4 class="modal-title">追加订单</h4>
	        </div>
		    <div class="modal-body" style="width:1000px;">
	      	<form action=""  method="post">
	      		<input type="hidden" id="zj_passengerId">
	      		<input type="hidden" id="zj_startLat">
	      		<input type="hidden" id="zj_startLng" >
	      		<input type="hidden" id="zj_endLat" >
	      		<input type="hidden" id="zj_endLng" >
	      		<input type="hidden" id="zj_startPrice" >
		  		<input type="hidden" id="zj_mileagePrice" >
		  		<input type="hidden" id="zj_runTimePrice" >
		  		<input type="hidden" id="zj_runTime" >
		  		<input type="hidden" id="zj_mileage" >
		  		<input type="hidden" id="zj_employId" >
		  		<div class="col-sm-6" style="z-index:8888; height:600px;">
	      		<div id="zj_allmap2" class="col-sm-12" style="z-index:8888; height:600px;">
    			</div>
    			</div>
	      		<div class="col-sm-6">
	      			<div class="form-group">
	                    <label class="col-sm-3 control-label">客户电话:</label>
	                    <div class="col-sm-9">
	                    	<input id="zj_passengerPhone"  class="form-control"></input>
	                    </div>
					</div>
					<div class="form-group">
	                    <label class="col-sm-3 control-label">客户姓名:</label>
	                    <div class="col-sm-9">
	                    	<input id="zj_passengerName"  class="form-control" ></input>
	                    </div>
					</div>
	      			<div class="form-group">
		                <label class="col-sm-3 control-label">所属公司:</label>
		                <div class="col-sm-9">
			                <select class="form-control" id="zj_companyId" >
								<#if companys??>
									<option value="">请选择公司</option>
									<#list companys as company>
										<option value="${company.id}" <#if companyId?? && companyId==company.id>selected="selected"</#if>>${company.abbreviation?if_exists}</option>
									</#list>
								</#if>
							</select>
		                </div>
					 </div>
					 <#-- <div class="form-group">
		                <label class="col-sm-3 control-label">始发地:</label>
		                <div class="col-sm-9">
		                	<div class="input-group">
		                    	<input id="zj_startAddress"  class="form-control"></input>
		                    	<span class="input-group-btn">
	                           		<button class="btn btn-default" type="button" id="zj_btn-startAddress">定位</button>
	                            </span>
                            </div>
		                </div>
	                </div>-->
	                 <div class="form-group zj_wayAddress" id="zj_start">
	                    <label class="col-sm-3 control-label" style="margin-top:50px;">始发地:</label>
	                    <div class="col-sm-8">
	                        <div class="panel panel-default">
	                           <div class="panel-body" style="padding:2 0 2 0;">
	                             <div>
	                                 <div style="padding:1 0 1 0">
	                                     <label class="col-sm-3 control-label">地址:</label>
	                                     <div class="col-sm-9">
	                                          <input class="form-control zj_waypointAddress" onblur='zj_position(this)' zj_index="0" zj_waypointLng="" zj_waypointLat="" id="zj_startAddress">
	                                          <label class="position" style="cursor:pointer;float:right;margin-right:-18px;margin-top:-26px;">
	                                             <i class=" icon-screenshot" title="定位"></i>
	                                          </label>
	                                     </div>
	                                 </div>
	                             <div>
	                             <label class="control-label col-sm-4" style="margin-left:-22px;">联系人:</label>
	                             <div style="width:165px;display:inline-block;margin-left:16px;">
	                             <input class="form-control zj_waypointContacts" />
	                             </div>
	                         </div>
	                       <div>
	                       <label class="col-sm-3 control-label">电话:</label><div class="col-sm-9">
	                       <input class="form-control zj_waypointPhone" required/></div></div></div></div></div></div><div class="input-group">
	                       </div><div class="input-group"></div></div>
	            <div id="zj_waypointItem">
	                
				</div>
				<#--
					<div class="form-group">
	                    <label class="col-sm-3 control-label">目的地:</label>
	                    <div class="col-sm-8">
	                    	<div class="input-group">
		                    	<input id="zj_destination"  class="form-control"></input>
		                    	<span class="input-group-btn">
	                           		<button class="btn btn-default" type="button" id="zj_btn-destination">定位</button>
	                            </span>
                            </div>
                    	</div>
                    	<div class="input-group">
                    	  <label><i class=" icon-plus icon-1x zj_waypointIcon zj_addAddress" style="cursor:pointer;" title="添加途径地"></i></label>
						</div>
					</div>-->
					<div class="form-group zj_wayAddress" id="zj_end">
	                    <label class="col-sm-3 control-label" style="margin-top:50px;">目的地:</label>
	                    <div class="col-sm-8">
	                        <div class="panel panel-default">
	                           <div class="panel-body" style="padding:2 0 2 0;">
	                             <div>
	                                 <div style="padding:1 0 1 0">
	                                     <label class="col-sm-3 control-label">地址:</label>
	                                     <div class="col-sm-9">
	                                          <input class="form-control zj_waypointAddress" onblur='zj_position(this)'  zj_index="1"  zj_waypointLng="" zj_waypointLat="" id="zj_destination">
	                                          <label class="position" style="cursor:pointer;float:right;margin-right:-18px;margin-top:-26px;">
	                                             <i class=" icon-screenshot" title="定位"></i>
	                                          </label>
	                                     </div>
	                                 </div>
	                             <div>
	                             <label class="control-label col-sm-4" style="margin-left:-22px;">联系人:</label>
	                             <div style="width:165px;display:inline-block;margin-left:16px;">
	                             <input class="form-control zj_waypointContacts" id="zj_contacts"/>
	                             </div>
	                         </div>
	                       <div>
	                       <label class="col-sm-3 control-label">电话:</label><div class="col-sm-9">
	                       <input class="form-control zj_waypointPhone" id="zj_phone" required/></div></div></div></div></div></div><div class="input-group">
                        	<label><i class=" icon-plus icon-1x zj_waypointIcon zj_addAddress" style="cursor:pointer;" title="添加途径地"></i></label>
	                       </div><div class="input-group"></div></div>
	                       
	                       
					<div class="form-group">
		                <label class="col-sm-3 control-label">预约时间:</label>
		                <div class="col-sm-9 input-append date " >
							  <input  class="inputTime"  id="zj_startTime" type="text"/>
							  <span class="add-on"><i class="icon-calendar"></i></span>
		                </div>
	                </div>
	                <div class="form-group">
						<label class="col-sm-3 control-label">货车类型:</label>
		                <div class="col-sm-9">
			                <select class="form-control" id="zj_truckTypeId" >
								<#if truckTypes??>
									<#list truckTypes as truckType>
										<option value="${truckType.id}">${truckType.typeName?if_exists}<#if truckType.cangointotown>--入城</#if></option>
									</#list>
								</#if>
							</select>
		                </div>
					 </div>
				    <div class="form-group">
					 	<label class="col-sm-3 control-label">预计金额:</label>
	                    <div class="col-sm-9">
	                    	<div class="input-group">
					          <input class="form-control" id="zj_budgetPay" type="number" min="0" />
				      		  <span class="input-group-addon">元</span>
				      		</div>
		                </div>
	                </div>
	                 <div class="form-group">
	                  <div class="input-group" style="margin-left:97px;">
					 	<ul class="dowebok">
							<li><input type="checkbox" name="zj_flitting"  data-labelauty="搬运"></li>
							<li><input type="checkbox" name="zj_receipt"  data-labelauty="回单"></li>
							<li><input type="checkbox" name="zj_receivedPay"   data-labelauty="回款"></li>
							<li style="position:relative;top:-5px;left:0px;display:none;" class="zj_receivedPay">
							     <input class="form-control" placeholder="金额" type="number" min="0" name="zj_payMount" style="width:80px;"/>
						 	     <span class="input-group-addon" style="height:34px;margin-top:50px;">元</span>
							</li>
						</ul>
						
						</div>
	                </div>
				 	<div class="form-group" style="margin-top:-35px;">
				 	 	<div class="col-sm-3">
	            	 	</div>
				 		<div class="col-sm-9 zj_detail">				               
		                  <span class="zj_mileage"></span>&nbsp&nbsp<span class="zj_runTime"></span>
		                </div>
	                </div>
	                 <div class="form-group">
						<label class="col-sm-3 control-label"><em>&nbsp;&nbsp;</em>订单备注:</label>
						<div class="col-sm-9">
							 <textarea class="form-control" cols="20" id='zj_orderMemo' name="memo" rows="4"></textarea>
						</div>
					 </div>
	               
	                <div class="form-group">
				 	 	<div class="col-sm-3">
	            	 	</div>
				 	 	<div class="col-sm-9">
	                 	  <input  type="button" class="btn btn-primary" id="zj_saveOrder" value="预约"/>
					      <button type="button"  class="btn btn-default" id="zj_close_modal">取消</button>
				        </div>
			        </div>
			        
	               
										
			 	</div>
			 	<div class="form-group">
				</div>
		  	</form>
	     	</div>
	     </div>
	</div>
</div>
<!--销单-->
<form class="form-horizontal" method="post">
		<div class="modal fade" id="dialog_cancel">
		  <div class="modal-dialog">
		    <div class="modal-content">
		      <div class="modal-header">
		        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
		        <h4 class="modal-title">输入销单原因</h4>
		      </div>
		      <div class="modal-body">
		      	<input type="hidden" name="id" id="dialog_cancel_id">
		      	
		      	<div class="form-group">
		            <div class="col-sm-12">
		                <p class="form-control-static">
							<label style="padding-right:20px;">
								<input type="radio" name="cancel_reason" value="与客户协商一致取消订单"> 与客户协商一致取消订单
							</label>
						</p>
		            </div>
		            <div class="col-sm-12">
		                <p class="form-control-static">
							<label style="padding-right:20px;">
								<input type="radio" name="cancel_reason" value="客户呼叫多人，只用先到服务人员"> 客户呼叫多人，只用先到服务人员
							</label>
						</p>
		            </div>
		            <div class="col-sm-12">
		                <p class="form-control-static">
							<label style="padding-right:20px;">
								<input type="radio" name="cancel_reason" value="客户拒接电话"> 客户拒接电话
							</label>
						</p>
		            </div>
		            <div class="col-sm-12">
		                <p class="form-control-static">
							<label style="padding-right:20px;">
								<input type="radio" name="cancel_reason" value="客户单方面取消"> 客户单方面取消
							</label>
						</p>
		            </div>
		            <div class="col-sm-12">
		                <p class="form-control-static">
							<label style="padding-right:20px;">
								<input type="radio" name="cancel_reason" value="other"> 其他
							</label>
						</p>
		            </div>
		        </div>
		      	
		      	<div class="form-group">
		            <div class="col-sm-12">
		                <textarea class="form-control" cols="20" id="dialog_cancel_content" name="content" rows="2" required></textarea>
		            </div>
		        </div>
		      </div>
		      <div class="modal-footer">
		    	<button type="button" class="btn btn-primary" id="ok_modal_cancel" action="${ctx}/freight/cancel">提交</button>
		    	<button type="button" class="btn btn-default" id="close_modal_cancel">关闭</button>
		      </div>
		    </div><!-- /.modal-content -->
		  </div><!-- /.modal-dialog -->
		</div>
		</form>

<!--添加备注-->
<div class="form-horizontal"  >
	<div class="modal fade" id="dialog_modifyCash">
	   <div class="modal-dialog">
	     <div class="modal-content">
	    	<div class="modal-header">
		        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
	        	<h4 class="modal-title">添加备注</h4>
	        </div>
		    <div class="modal-body">
	      	<form action=""  method="post">
	      		<input type="hidden" id="orderId"/>
	      		
		      	<div class="form-group">
	      	 		<label class="col-sm-3 control-label">订单号：</label>
                    <div class="col-sm-8">
                    	<label  class="control-label" id="orderNo" ></label>
                    </div>
		        </div>
		         <div class="form-group">
                    <label class="col-sm-3 control-label">新备注：</label>
                    <div class="col-sm-8">
                    	<textarea class="form-control" cols="60"  id="memo" rows="3" required></textarea>
                    </div>
				 </div>
				 
		         <div class="form-group">
                    <label class="col-sm-3 control-label">原有备注：</label>
                    <div class="col-sm-8">
                    	<textarea class="form-control" cols="60"  id="oldmemo" rows="6" readonly style="background-color:#FFFFFF;cursor:pointer;" required></textarea>
	                </div>
				 </div>
				   <div class="form-group">
                 	  <div class="col-sm-6">
                	  </div>
                	  <div class="col-sm-3">
					      <input  type="button" class="btn btn-primary" id="save" value="确定">
					      <button type="button" class="btn btn-default" id="close_modal_memo">关闭</button>
		        	  </div>
		           </div>  
		  	</form>
	     	</div>
	     </div>
	  </div>
	</div>
</div>	

</@override>
<@override name="footer">
<script type="text/javascript" language="javascript">
	window.daijia = {ctx : '${ctx}',lng : '${lng}', lat : '${lat}'};
</script>
<script src="${ctx}/assets/js/bootstrap-datetimepicker.min.js"></script>
<script src="${ctx}/assets/js/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="//api.map.baidu.com/api?v=2.0&ak=AuNk3YS21DSmHEEvIFDf9dbD" type="text/javascript"></script>
<script src="${ctx}/assets/js/jquery.autocomplete.min.js"></script>
<script src="${ctx}/assets/js/freight/jquery-labelauty.js"></script>
<script src="${ctx}/assets/js/freight/create.js"></script>
<script src="${ctx}/assets/js/freight/addmore.js"></script>

<script type="text/javascript">
$(document).ready(function(){
$(':checkbox').labelauty();
	$("#startTime").datetimepicker({format: 'yyyy-mm-dd HH:ii', language: 'zh-CN', minView: 'hour', pickDate: true, pickTime: false, inputMask: false, autoclose: true });
	$("#zj_startTime").datetimepicker({format: 'yyyy-mm-dd HH:ii', language: 'zh-CN', minView: 'hour', pickDate: true, pickTime: false, inputMask: false, autoclose: true });
	$('#startTime').change(function(){
 		if(!(/^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)\s+([01][0-9]|2[0-3]):[0-5][0-9]$/.test($('#startTime').val()))){
           $.scojs_message("请输入正确的时间格式,如:2015-12-30 12:30", $.scojs_message.TYPE_ERROR);
           $('#startTime').val('');
      	}
	});
	$('#zj_startTime').change(function(){
 		if(!(/^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)\s+([01][0-9]|2[0-3]):[0-5][0-9]$/.test($('#zj_startTime').val()))){
           $.scojs_message("请输入正确的时间格式,如:2015-12-30 12:30", $.scojs_message.TYPE_ERROR);
           $('#zj_startTime').val('');
      	}
	});	
	$("#addOrder").click(function(){
		$('#dialog_order').modal();
	});
	
	$("#close_modal").click(function(){
		$('#dialog_order').modal("hide");
	});

	


	//销单
$(".cancel").click(function(){
    	$("#dialog_cancel_id").val($(this).attr('orderId'));
    	$("#ok_modal_cancel").attr("disabled",false);
    	$('#dialog_cancel').modal();
    });
	$("#close_modal_cancel").click(function(){
		$('#dialog_cancel').modal("hide");
	});
	$("#ok_modal_cancel").click(function(){
		if($("input[name=cancel_reason]:checked").length==0){
			$.scojs_message("请选择销单原因", $.scojs_message.TYPE_ERROR);
			return false;
		}
		if($("input[name=cancel_reason]:checked").val()=="other" && $("#dialog_cancel_content").val().length==0){
			$.scojs_message("请输入销单原因", $.scojs_message.TYPE_ERROR);
			return false;
		}
		var content="";
		if($("input[name=cancel_reason]:checked").val()=="other"){
			content=$("#dialog_cancel_content").val();
		}else{
			content=$("input[name=cancel_reason]:checked").val();
		}
		$(this).attr("disabled",true);
		$.post($(this).attr("action"),{'id':$("#dialog_cancel_id").val(),'cause':content},function(data){
            if(data.success){
                $.scojs_message(data.message, $.scojs_message.TYPE_OK);
            	setTimeout(function(){
							window.location.reload(true);
						}, 300);
            }else{
            	$.scojs_message(data.message, $.scojs_message.TYPE_ERROR);
            }
		},'json');
	});
	
		
$(".modifyCash").click(function(){
		var  orderId=$(this).attr('orderId');
		var orderNo=$(this).attr('orderNo');
		var orderMemo=$(this).attr('orderMemo');
		$('#orderId').val(orderId);
		$('#orderNo').html(orderNo);
		$('#oldmemo').html(orderMemo);
    	$('#dialog_modifyCash').modal();
    });
    $("#save").click(function(){
    	var content=$("#memo").val();
	     	$('#dialog_modifyCash').modal("hide");
				$.post('${ctx}/freight/remark',{'id':$('#orderId').val(),'memo':content},function(data){
		           if(data.success){
		                $.scojs_message(data.message, $.scojs_message.TYPE_OK);
		                setTimeout(function(){
							window.location.reload(true);
						}, 1000);
			       }else{
		                $.scojs_message(data.message, $.scojs_message.TYPE_ERROR);
		                setTimeout(function(){
							window.location.reload(true);
						}, 1000);
			       }
			    },'json');
     });
    $("#close_modal_memo").click(function(){
		$('#dialog_modifyCash').modal("hide");
	});
});			

</script>
</@override>
<@extends name="../layout.ftl"/>
